<template>
  <div>
    <div v-if="isBack">
      <el-page-header class="header" @back="goBack">
        <div slot="title"><div class="font18">返回</div></div>
        <div slot="content">
          <div class="font24" style="color: #343739">{{ content }}</div>
        </div>
      </el-page-header>
    </div>
    <div v-else class="title font24 header">
      <span>{{ content }}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: "header",
  props: {
    content: String,
    isBack: {
      type: Boolean,
      required: false,
      default() {
        return false;
      },
    },
  },
  methods: {
    goBack() {
      this.$router.go(-1);
    },
  },
};
</script>

<style scoped>
.title {
  align-items: center;
  display: flex;
  line-height: 0.125rem;
  color: #343739;
}
.header {
  margin: 0 15px 15px 0;
}
</style>